import React from 'react';

class SetInputData extends React.Component{
    constructor(props){
        super(props);

        this.upData = this.upData.bind(this);
        this.setUserName = this.setUserName.bind(this);
        this.setPassword = this.setPassword.bind(this);
        this.setUserType = this.setUserType.bind(this);
        this.setTx = this.setTx.bind(this);
        this.setJj = this.setJj.bind(this);
        this.setZw = this.setZw.bind(this);
        this.setM = this.setM.bind(this);
        this.sendMsg = this.sendMsg.bind(this);
    }

    sendMsg(data){
        this.upData('sendMsg', data);
    }

    setTx(data){
        this.upData('tx', data);
    }

    setJj(data){
        this.upData('jj', data);
    }

    setZw(data){
        this.upData('zw', data);
    }

    setM(data){
        this.upData('m', data);
    }

    setUserName(data){
        this.upData('userName', data);
    }

    setPassword(data){
        this.upData('password', data);
    }

    setUserType(data){
        this.upData('userType', data)
    }

    upData(key = "", val = ""){
        this.setState({
            [key]: val
        });
    }

}

export { SetInputData };